static char* encoded_points = NULL;
static char* encoded_levels = NULL;
-static char* script = NULL;
+static QString script;
static route_head** routehead;
static int* routecount;
static short_handle desc_handle;
void goog_script(xg_string args, const QXmlStreamAttributes*)
{
- if (script) {
- script = xstrappend(script, CSTRc(args));
- } else {
- script = xstrdup(args);
- }
+ script += args;
}
}
static char goog_segname[7];
-static char* goog_realname = NULL;
+static QString goog_realname;
static int goog_segroute = 0;
/*
void goog_td_b(xg_string args, const QXmlStreamAttributes*)
{
if (goog_segname[0] == '\\' && !strchr(CSTRc(args), '\xa0')) {
- if (goog_realname) {
- xfree(goog_realname);
- goog_realname = NULL;
- }
- goog_realname = (char*) xmalloc(strlen(CSTRc(args))+1);
- strcpy(goog_realname, CSTRc(args));
+ goog_realname = args;
}
}
+
void goog_td_e(xg_string args, const QXmlStreamAttributes*)
{
- if (goog_segname[0] == '\\' && goog_realname) {
+ if (goog_segname[0] == '\\' && !goog_realname.isEmpty()) {
goog_segment(goog_realname, NULL/*unused*/);
}
goog_segname[0] = '\0';
- if (goog_realname) {
- xfree(goog_realname);
- goog_realname = NULL;
- }
+ goog_realname.clear();
}
static long decode_goog64(char** str)
xfree(encoded_levels);
encoded_levels = NULL;
}
- if (script) {
- char* xml = strchr(script, '\'');
- char* dict = strstr(script, "({");
-
+ if (!script.isEmpty()) {
+ // TODO: rethink with Qt to make this less dependent on strchr...
+ char* s = xstrdup(script);
+ char* xml = strchr(s, '\'');
+ char* dict = strstr(s, "({");
char* end = NULL;
if (xml && (!dict || (xml < dict))) {
}
}
}
- xfree(script);
+ script.clear();
xfree(routehead);
xfree(routecount);
- script = NULL;
+ xfree(s);
}
/*